package ru.autofan.logic.dao;

import java.io.Serializable;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class DomainFactory extends HibernateDaoSupport {

	public <T> T get(Class<T> clazz, Serializable id) {
		if (id == null) {
			return null;
		}
		return clazz.cast(getSession().get(clazz, id));
	}
	
	public void delete(Object object) {
		getSession().delete(object);
	}
	
	public void save(Object object) {
		getSession().save(object);
	}
}
